import request from '@/utils/request'

export function getListMenu(query) {
  return request({
    url: '/sysm/menu/',
    method: 'get',
    params: query
  })
}

export function getList(query) {
  return request({
    url: '/sysm/menu/listTableTree',
    method: 'get',
    params: query
  })
}

export function getListTree(query) {
  return request({
    url: '/sysm/menu/listTree',
    method: 'get',
    params: query
  })
}

export function getMenuByApp(query) {
  return request({
    url: '/sysm/menu/listMenu',
    method: 'get',
    params: query
  })
}

export function saveOrUpdate(param) {
  return request.post('/sysm/menu/', JSON.stringify(param))
}

export function updateStatus(param) {
  return request({
    url: `/sysm/menu/updateStatus`,
    method: 'post',
    params: param
  })
}

export function deleteById(id) {
  return request({
    url: `/sysm/menu/${id}`,
    method: 'delete'
  })
}

